import KnapsackModel from "../model/KnapsackModel";
import UIManager from "../manager/UIManager";
import UIConst from "../const/UIConst";
import LoginModel from "../model/LoginModel";

const {ccclass, property} = cc._decorator;

@ccclass
export default class TopMenu extends cc.Component {

    @property(cc.Button)
    btn_knapsack: cc.Button = null;
    @property(cc.Label)
    txt_name:cc.Label = null;
    @property(cc.Label)
    txt_sex:cc.Label = null;

    private onKnapsack() {
        KnapsackModel.instance.actionEnterKnapsackView(function(){
            UIManager.instance.show(UIConst.VIEW_KNAPSACK,true)
        })
        
    }
    // private becomeRed() {
    //     this.node.color=cc.color(0,0,200)
    // }
    start () {
        this.txt_name.string = LoginModel.instance.userData.name
        this.txt_sex.string = (LoginModel.instance.userData.sex==0)&&"性别:男"||"性别:女"
    }

    // update (dt) {}
}
